// 纪实模块相关
let base = config.ip
let projectName = '/rcdg-record'
import { get, post } from './http.js'

// 查询分管和直管机构
export const getUserChargeOrgDetail = p => post(`${base}${projectName}/sa-record-note/getUserChargeOrgDetail`, p)
// 查询机构下人员
export const getListUserDetailByOrgId = p => post(`${base}${projectName}/sa-record-note/listUserDetailByOrgId`, p)

// 获取日历筛选列表
export const listRecordNoteCalendar = p => get(`${base}${projectName}/record-base/listRecordNoteCalendar`, p)

// 获取纪实详情
export const getRecordNoteDetails = p => post(`${base}${projectName}/sa-record-note/getRecordNoteDetails`, p)

// 获取纪实详情
export const getRecordNoteSeasonDetails = p =>
  post(`${base}${projectName}/sa-record-note/getRecordNoteSeasonDetails`, p)

/************************* 考核登记表 *************************/
// 查询登记详情信息
export const getFormByNoteId = p => post(`${base}${projectName}/form-evaluation/getFormByNoteId`, p)
// 保存/暂存登记详情
export const saveForm = p => post(`${base}${projectName}/form-evaluation/saveForm`, p)

//收藏为个人纪实条目模板
export const collectNoteTemplateInfo = p => post(`${base}${projectName}/record-template/collectNoteTemplateInfo`, p)
//删除纪实条目模板
export const delNoteTemplateInfo = p => post(`${base}${projectName}/record-template/delNoteTemplateInfo`, p)
//查询工作纪实条目模板列表
export const queryNoteTemplateList = p => get(`${base}${projectName}/record-template/queryNoteTemplateList`, p)

//根据代码类型查询对应的代码表
export const queryCodeInfo = p => post(`${base}${projectName}/code-public/queryCodeInfo`, p)
//根据代码类型查询对应的代码表
export const queryRoleCodeInfo = p => post(`${base}${projectName}/code-public/queryRoleCodeInfo`, p)
// 周纪实回退及提交工作建议
export const addAndBack = p => post(`${base}${projectName}/record-base/add`, p)

// 工作催报
export const saveUrgeByNeedDeal = p => post(`${base}${projectName}/form-progress/saveUrgeByNeedDeal`, p)

// 纪实中的工作建议保存
export const addRecordProblem = p => post(`${base}${projectName}/record-base/addRecordProblem`, p)
export const addRecordProblemLoading = p =>
  post(`${base}${projectName}/record-base/addRecordProblem`, p, {
    headers: {
      hideLoading: true,
    },
  })
// 纪实回复更多列表查询
export const listRecordNoteSuggestPage = p =>
  get(`${base}${projectName3}/sa-record-problem/listRecordNoteSuggestPage`, p)
// 纪实回复详情查询
export const getNoteSuggestDetail = p => get(`${base}${projectName3}/sa-record-problem/getNoteSuggestDetail`, p)

// 纪实模板是否展示
// 查询 recordType
export const selectUserRememberTips = p => get(`${base}${projectName}/common-bus/selectUserRememberTips`, p)
// 关闭 recordType
export const addUserRememberTips = p =>
  get(`${base}${projectName}/common-bus/addUserRememberTips`, p, {
    headers: {
      hideLoading: true,
    },
  })

// 记录纪实填写方式
// 获取上次纪实填写的方式
export const getRememberWriteRecordTips = p => get(`${base}${projectName}/common-bus/getRememberWriteRecordTips`, p)
// 记录填写纪实最后的方式
export const rememberWriteRecordTips = p => get(`${base}${projectName}/common-bus/rememberWriteRecordTips`, p)

// 根据时期获取纪实详情信息
export const getRecordDetailByPeriod = p => post(`${base}${projectName}/record-base/v2/getRecordDetailByPeriod`, p)

// 保存纪实信息(季)
export const addRecordNoteSeason = p => post(`${base}${projectName}/record-base/v2/addRecordNoteSeason`, p)
export const addRecordNoteSeasonLoading = p =>
  post(`${base}${projectName}/record-base/v2/addRecordNoteSeason`, p, {
    headers: {
      hideLoading: true,
    },
  })

// 获取周纪实
export const getWeekRecordForm = p => post(`${base}${projectName}/record-base/v2/getWeekRecordForm`, p)

// 保存|暂存 周工作纪实信息
export const addRecordNoteWeek = p => post(`${base}${projectName}/record-base/v2/addRecordNoteWeek`, p)

export const addRecordNoteWeekLoading = p =>
  post(`${base}${projectName}/record-base/v2/addRecordNoteWeek`, p, {
    headers: {
      hideLoading: true,
    },
  })

// 检查是否可提交纪实(周&月)
export const checkSubmitRecord = p => post(`${base}${projectName}/record-base/v2/checkSubmitRecord`, p)

// 2查询月小结详情信息
export const getMonthRecordForm = p => post(`${base}${projectName}/record-base/v2/getMonthRecordForm`, p)

// 2保存月小结纪实信息
export const addRecordNoteMonth = p => post(`${base}${projectName}/record-base/v2/addRecordNoteMonth`, p)

// 2保存月小结纪实信息
export const addRecordNoteMonthLoading = p =>
  post(`${base}${projectName}/record-base/v2/addRecordNoteMonth`, p, {
    headers: {
      hideLoading: true,
    },
  })

// 获取看纪实机构和人员列表
export const getlistOrganRecordNotes = p => post(`${base}${projectName}/record-base/v2/listOrganRecordNotes`, p)

// 获取看纪实列表
export const getlistRecordNoteCalendarV2 = p => post(`${base}${projectName}/record-base/v2/listRecordNoteCalendarV2`, p)

// V2获取看纪实机构列表
export const getlistLookOrgan = p => post(`${base}${projectName}/record-base/v2/listLookOrgan`, p)

// V2获取看纪实人员列表
export const getlistLookUser = p => post(`${base}${projectName}/record-base/v2/listLookUser`, p)

// 获取模板根据代码值
export const getTemplateByCode = p => post(`${base}/rcdg-agile-table/template/getTemplateByCode`, p)

// 暂存/保存年度个人|部门纪实信息
export const addRecordNoteYear = p => post(`${base}${projectName}/record-base/addRecordNoteYear`, p)

// 获取本年季度纪实概要
export const listQuarterRecordTitles = p => get(`${base}${projectName}/record-base/listQuarterRecordTitles`, p)

// 查询年度登记详情信息
export const getYearRecordForm = p => post(`${base}${projectName}/record-base/getYearRecordForm`, p)

// 保存年度登记详情信息
export const saveYearRecordForm = p => post(`${base}${projectName}/record-base/saveYearRecordForm`, p)

// 保存上级纪实退回信息
export const saveReturn = p => post(`${base}${projectName}/record-base/saveReturn`, p)

// 保存上级纪实答复信息
export const saveSuggest = p => post(`${base}${projectName}/record-base/saveSuggest`, p)

// 查询首页纪实回复列表
export const pageSelfRecordSuggest = p => get(`${base}${projectName}/record-suggest/pageSelfRecordSuggest`, p)
